package com.jiesen.base.modules.login.jsPermission.utils;

import com.jiesen.base.modules.login.jsPermission.model.Permission;

public class PermissionUtils {

    public static Permission permissionComplete(Permission permission){
        //权限名称
        if (permission.getName() == null) {
            return null;
        }
        //父类id
        if (permission.getParentId() == null) {
            permission.setParentId(0);
        }
        //设置权限类型，默认列表
        if(permission.getType()==null){
            permission.setType(0);
        }
        //设置锁自动生效
        if(permission.getLock()==null){
            permission.setLock(1);
        }
        return permission;
    }
}
